home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_torchlight2.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  84 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_torch.cog
  4. #    An alternative to gen_torchlight if hardcoded values are preferable.
  5. #    Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup
  6. #    Best use: Rename for target level and adjust hardcoded values as required.
  7. #
  8. # [SXC] [RKD]
  9. #
  10. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16. message     activated
  17. message     startup
  18.  
  19. thing       torch                //the thing you light
  20. thing       flame    nolink        //flame, hidden at startup
  21. thing        player    local
  22.  
  23. sound       burning=gen_torch_burnin_c.wav  local
  24.  
  25. vector      minlite        local
  26. vector      maxlite        local
  27.  
  28. flex        minradius=0.25    local
  29. flex        maxradius=0.3    local
  30.             
  31. flex        reach=0        //0 for medium, 1 for high
  32. flex        islit=0        //set to 1 if torch lights at startup
  33. flex        flicker=1    //set to 0 to eliminate flicker
  34.  
  35. # subroutine
  36. flex        lightit=0.0        local
  37. end
  38.  
  39. # ========================================================================================
  40.  
  41. code
  42.  
  43. startup:
  44.     player = GetLocalPlayerThing();
  45.     minlite = VectorSet(0.87, 0.55, 0.06);
  46.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  47.     SetThingFlags(flame, 0x10);
  48.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
  49.  
  50.     if (islit) call lightit;    
  51.     return;
  52.  
  53. # ........................................................................................
  54. activated:
  55.     if (islit) return;
  56.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  57.     
  58.     PlayMode(player, (60 + reach), 0);
  59.     Sleep(0.5);        //no return, falls through to lightit
  60.  
  61. # ........................................................................................
  62.  
  63. lightit:
  64.     ClearThingFlags(flame, 0x10);
  65.     SetThingLight(torch, minlite, 0.3, 0.5);
  66.         
  67.     Sleep(0.5);
  68.  
  69.     PlaySoundThing(burning, torch, 1, 3, 10, 1);
  70.     islit = 1;
  71.     
  72.     if (flicker == 0) return;
  73.     ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
  74.     return;
  75.  
  76. end
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.